import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Properties;

import org.apache.log4j.Logger;


public abstract class DBDAO {
	
	Logger logger = Logger.getLogger(this.getClass() );
	
	
	private String user = null;
	private String password = null;
	private String dbURL = null;
	private String driverName = null;
	
	private java.sql.Connection conn  = null;
	private java.sql.PreparedStatement pstmt = null;
	private java.sql.ResultSet rs = null;
	
	public DBDAO( String user, String password, String dbURL, String driverName ) {
		
		this.user = user;
		this.password = password;
		this.dbURL = dbURL;
		this.driverName = driverName;
		
	}
	
	public java.sql.Connection connect() throws SQLException, ClassNotFoundException {
		
		Class.forName( this.driverName);
		
		Properties dbProperties = new Properties();
		
		dbProperties.setProperty( "user", this.user);
		dbProperties.setProperty( "password", this.password);
		
		try { 
			this.conn = DriverManager.getConnection( this.dbURL, dbProperties);
			System.out.println( "DB Connected.");
		
		} catch( Exception e) {
			e.printStackTrace();
		
		}
 		
		return this.conn;
		
	}
	
	public void disconnect() throws SQLException {
		
		this.conn.close();
		
		System.out.println( "DB Disconnected.");
		
	}
	
	public String getSchemas() throws SQLException {
		return this.conn.getSchema();
	}
	
	public ArrayList< EMP_TARGET > select( String sql ) throws SQLException {
		
		return null;
	};
	
	public ArrayList<Object> select( Class obj, String sql ) {
		
		return null;
	};
	
	public int insert( String sql ) {
		
		return 0;
	}
	
	public int insert( ArrayList< EMP_TARGET > selectArray ) throws SQLException {
		
		return 0;
	}
	
	public int insertENAME( String ename ) {
		
		return 0;
	};
	
	public static void main ( String args[]) {
//		DBDAO dbDAO = new DBDAO() {
//		};
	}
}
